package com.oms.service.impl;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.transaction.annotation.Transactional;

import com.oms.dao.BaseDao;
import com.oms.service.BaseService;

@Transactional
public class BaseServiceImpl<T> implements BaseService<T> {

    /** 
     * 注入BaseDao 
     */  
    private BaseDao<T> dao;  
    @Resource  
    public void setDao(BaseDao<T> dao) {  
        this.dao = dao;  
    } 
    
	@Override
	public void save(T t) {
		dao.save(t);
	}
	
	@Override
	public void update(T t) {
		// TODO Auto-generated method stub
		dao.update(t);
	}

	@Override
	public void del(Serializable pk) {
		// TODO Auto-generated method stub
		dao.del(pk);
	}


	@Override
	public void del(T t) {
		// TODO Auto-generated method stub
		dao.del(t);
	}

	@Override
	public T findById(Serializable pk) {
		// TODO Auto-generated method stub
		return dao.findById(pk);
	}

	@Override
	public List<T> findAll() {
		// TODO Auto-generated method stub
		return dao.findAll();
	}

	@Override
	public List<T> findByPage(int start, int count) {
		// TODO Auto-generated method stub
		return dao.findByPage(start, count);
	}

	@Override
	public List<T> list(String hql, Object... params) {
		// TODO Auto-generated method stub
		return dao.list(hql, params);
	}

	@Override
	public int getTotalCount(String hql, Object... params) {
		// TODO Auto-generated method stub
		return dao.getTotalCount(hql, params);
	}

	@Override
	public List<T> list(String hql, int firstResult, int maxResults, Object... params) {
		// TODO Auto-generated method stub
		return dao.list(hql, firstResult, maxResults, params);
	}




}
